Method and device for transmitting software

ABSTRACT

A method for transmitting software in which a checker generates two random numbers. The checker calculates a cryptographic key based on the second random number based on a measured hardware function of the device. The checker encrypts the software into a cryptogram using the key, and transmits the cryptogram to the device. The checker transmits the first random number to the device, and receives a checksum from the device. The checker calculates a reference value based on the first random number and an emulated random access memory of the device, with the aid of the measured hardware function and a predefined cryptographic hash function. The checker subjects the checksum to a check based on the reference value, and if the check is successful, the checker transmits the second random number to the device.

CROSS REFERENCE

The present application claims the benefit under 35 U.S.C. §119 of German Patent Application No. DE 102015225651.0 filed on Dec. 17, 2015, which is expressly incorporated herein by reference in its entirety.

FIELD

The present invention relates to a method for transmitting software. In addition, the present invention relates to a corresponding device, a corresponding computer program, and a corresponding storage medium.

BACKGROUND INFORMATION

As a branch of information technology, information security is concerned with various issues, which are referred to in technical terminology as security objectives. In addition to availability and confidentiality, the integrity constitutes one of the typical security objectives. This is to be understood to mean the prevention of unauthorized modification of information in accordance with the internationally standardized Common Criteria for Information Technology Security Evaluation (CC). The additional security objective of authenticity describes the characteristics of authenticity, verifiability, and reliability of an object, in particular of a device.

The aforementioned objectives are of particular importance in the relatively new research field of cyber-physical systems (CPS). Those skilled in the art understand this general term to mean the combination of information technology-related or software-related components with mechanical or electronic parts which communicate via a data infrastructure such as the Internet. One design of cyber-physical systems results from the networking of embedded systems via wired or wireless communication networks, in particular so-called sensor networks.

In order to determine the originality of a component, PCT Application No. WO 2013 160032 A1 describes that a signature which is associated with the component is verified with the aid of a public key, at least one individual characteristic of the component being used for detecting the originality, without exclusive access to secret data being necessary. An up-to-date identifier, for example, a PUF value, is created as a function of at least one component-specific characteristic of the component. If the up-to-date created identifier corresponds to the verified signature, the originality of the component is deduced. In this case, the signature corresponds to a code word which is encrypted with the aid of a private key, for example, a private key of the manufacturer of the component.

SUMMARY

The present invention provides a method for transmitting software, a corresponding device, a corresponding computer program, and a corresponding storage medium.

One advantage of this approach is the guaranteed security that authentic software is downloaded and executed on an authentic hardware device, for example, a sensor. However, existing approaches may typically check only one of the two security criteria at once.

In contrast to a conventional attestation of the software integrity in terms of trusted computing, the provided method does not necessarily require the remote and yet precise measurement of the execution time on the sensor device.

In contrast to the aforementioned conventional approach, the mechanism according to the present invention also deals effectively with the situation in which a sensor has been infected with malware. Here, the approach of the checker is independent of whether or not malware is present. Here, all of the software of the target device is deleted and replaced by trusted software.

Unlike a great number of conventional approaches, the provided approach includes a characteristic related to implicit mutual authentication. Assuming that only the legitimate checker is capable of emulating the hardware function, or has previously measured it, a meaningful encryption may be calculated only by the legitimate checker. Thus, after the decryption, the checker may check for the existence of an artefact in the decrypted code, for example, a checksum of a portion of the software, and thus ensure that the software was encrypted by a legitimate source, for example, by an authentic hub.

In contrast to existing systems, one specific embodiment of the present invention requires no direct communication link, in particular no cable connection, between the checker and the device to be checked. Generally, the existing systems even require the communication between the checker and the device to be the sole communication, i.e., eavesdropping operations are impossible.

In addition, the approach in accordance with the present invention discussed herein prevents attacks which target the software as intellectual property, since the software may be decrypted only by the authorized, typically embedded device.

Advantageous refinements and improvements of the present invention are possible via the measures described herein. Thus, it may be provided that the hardware function is a physically unclonable function (PUF) of the device, or is based on a trusted platform module (TPM) of the device, a secret which characterizes the device, or a SIMPL system of the device, as recommended in U. Rührmair, “SIMPL systems: On a public key variant of physical unclonable functions,” IACR Cryptology ePrint Archive, no. 255, 2009, and in U. Rührmair, “SIMPL Systems, or in SOFSEM 2011: Theory and Practice of Computer Science, pp. 26-45, Springer, 2011. In these cases, it is not possible for an active attacker to pose as the authorized device. In order to achieve this, the attacker would, for example, have to break the TPM cryptographically or clone the PUF, but it is not possible to carry out either of these attacks in practice with a reasonable level of effort.

According to another aspect, it may be provided that the software includes an executable program, for example, a code update, and the device executes this program after the decryption of the software. In this case, after the software update, the sensor device may provide the proof to the checker that it has successfully carried out the code update.

BRIEF DESCRIPTION OF THE DRAWINGS

Exemplary embodiments of the present invention are depicted in the figures and are described in greater detail below.

FIG. 1 shows the schematically simplified architecture of a sensor connected to a hub.

FIG. 2 shows the sequence diagram of a method according to one specific embodiment of the present invention.

DETAILED DESCRIPTION OF EXAMPLE EMBODIMENTS

A method according to the present invention may, for example, be implemented in software or hardware or in a hybrid form from software and hardware, for example, in an embedded device 11 and a hub functioning as a checker 10, as the exemplary smart home scenario of FIG. 1 illustrates. In this case, the term “hub” is to be understood not in the limited sense of the ISO/OSI reference model, but rather in a broad sense, which includes every node networked with device 11, in particular wirelessly, if this hub is suitable for connecting device 11 to other nodes into a computer network, for example, a wireless sensor network.

In addition to possible additional components not depicted graphically, device 11 itself includes a random access memory 12 designed as a static random access memory (SRAM) having a physically unclonable hardware function 14 and sufficient memory capacity for storing software 13 provided for its operation. In the present embodiment, device 11 also includes a microcontroller 15, read-only memory (ROM) 16, and a wireless interface 17 which is suitable for reciprocal data exchange with checker 10.

FIG. 2 illustrates the sequence of method 20. It enables secure transmission and in particular updating of software 13 by linking software 13 to the authentic device 11 in a specific unrelenting manner with respect to electronic eavesdropping operations, man-in-the-middle attacks, malware, and counterfeit or manipulated hardware. The two parties, checker 10 and device 1), are involved in the provided mechanism. Device 11 must prove its authenticity and (software) integrity with respect to checker 10. Since checker 10, in this case, the hub, generally has sufficient computing resources, it is assumed below that its security is ensured via other mechanisms such as antivirus software 13, code signing, address space layout randomization, control flow integrity, or the like. In other words, it is to be generally assumed that checker 10 is reliable.

A basic assumption of the present embodiment is the presence of a manipulation-proof function f, which is inseparably linked to the authentic hardware of device 11. In other words, if a valid result R=f(C) is returned to checker 10 for any arbitrary input c, this may infer that function f was actually carried out by this specific, legitimate device 11. Examples of such a function include TPM, PUF 14 depicted in FIG. 1, and routines for integrity attestation. Generally, assuming that each checker 10 has a specific secret for device 11 which cannot be easily extracted by an attacker, a simple block code or a so-called keyed-hash function, for example, a keyed-hash message authentication code (HMAC) based on the hash function, may emulate function f.

It is furthermore assumed that checker 10 has a function f′ which may be used to emulate the function f, although with certain limitations with respect to execution time or memory use. Examples of such a function f′ include knowledge of the public key of the specific TPM, knowledge of the challenge-response pairs of PUF 14, or, in the case of a weak PUF 14, knowledge about the secret keys stored by the latter. Other examples of f′ which are not based on secret knowledge include the aforementioned SIMPL systems and the runtime behavior [of] selected program codes executed on device 11.

Given these two assumptions, method 20 ensures the authenticity of device 11 and the integrity of software 13 which device 11 will execute after method 20 is completed.

In first step 21, checker 10 generates two random numbers C₁ and C₂ with the aid of a suitable random number generator, for example, a physical random number generator (true random number generator, TRNG). It then calculates a shared secret key k according to the following rule:

k=f′(C ₂)

Next, checker 10 encrypts (step 22) software 13 to be transmitted and to be executed by device 11 using the secret key k, as follows:

SW _(k) =E _(k)(SW/random)

Here, E_(k) refers to a cryptogram obtained, for example, according to AES with the aid of the secret key k. Software 13 is padded with random data in order to ensure that the resulting cryptogram E_(k)(SW/random) has approximately the same size as random access memory 12 of device 11, so that there is very little remaining capacity of random access memory 12 for carrying out the rest of method 20. Checker 10 now transmits the cryptogram SW_(k) to device 11.

After receiving cryptogram SW_(k), device 11 stores (step 26) it in its writable memory, including random access memory 12, whereby it overwrites its full previous memory content, including any malicious software. The content of random access memory 12 of device 11, after it has stored SW_(k), is denoted by M below.

In next step 23, checker 10 transmits random number C₁ to device 11. In turn, the device uses C₁ as the input of the aforementioned function f. Result f(C₁) is fed to a checksum function g (step 27), together with content M of random access memory 12 of device 11, and thus the proof is provided that device 11 has stored the full received cryptogram, so that it may be assumed that any malware has been deleted, and device 11 has access to function f:

CHK=g(f(C ₁),M)

Examples of function g include cryptographic signatures such as HMAC, cryptographically secure hash functions such as the hash functions of the SHA family, or, if the security risks are justifiable, any other (suitable) hash function, for example, a cyclic redundancy check (CRC).

Optionally, checker 10 measures (step 24) a set of predefined logical and/or physical measured variables O, while device 11 calculates the checksum CHK=g(f(C₁), M). As a following step 25 illustrates, monitoring O provides additional options for checking whether it is actually the specific (authentic) device 11 which executes function f. An example of a physical measured variable is the distance measurement, i.e., the measurement carried out by checker 10, of the execution time of f.

In the following step, device 11 transmits the checksum CHK to checker 10. The checker calculates a reference value g (f′(C₁, M)) and compares it (step 25) to the received checksum CHK. Optionally, checker 10 calculates the expected values O′ of the predefined logical and/or physical measured variables and compares the results to the actual measurements O.

If the checks 25 run successfully, i.e., the values returned by device 11 and the values of checker 10 agree, checker 10 transmits random number C₂ to device 11. The device calculates k=f(C₂) and decrypts (step 28) the cryptogram SW_(k) by calculating D_(k)(E_(k)(SW)), where D_(k) denotes a decryption, for example, according to AES using the secret key k. This is the last step of the provided method 20. After the decryption of software 13, device 11 may execute it and thereby switch into normal operating mode, for example, for transmitting measured sensor values to the hub functioning as checker 10.

Since, apart from checker 10, only the legitimate device 11 is able to calculate the correct result k=f(C₂), method 20 ensures that only the legitimate device 11 is able to decrypt software 13. This in turn prevents third parties from decrypting and operating software 13. In other words, it prevents the theft of intellectual property (IP), for example, via dissemination and reverse engineering of software 13, and eliminates the threat caused by counterfeit sensors connected to the hub. Since, in addition, checksum CHK of content M of random access memory 12 of device 11 is checked before device 11 is allowed to decrypt software 13, i.e., before the transmission of C₂ to device 11, it is ensured that no malware is present in random access memory 12 of device 11 if, by transmitting C₂, checker 10 is enabled to decrypt and execute the original software 13. Finally, since only the legitimate checker 10 is able to calculate the key k=f′(C₂), device 11 is assured of the authenticity of checker 10. 

What is claimed is:
 1. A method for transmitting software to a remote device, comprising: generating, by a checker, a first random number and a second random number; calculating, by the checker, a cryptographic key based on the second random number with the aid of an emulated or previously measured hardware function of the device; encrypting, by the checker, the software into a cryptogram using the key; transmitting to the device by the checker the cryptogram; transmitting to the device by the checker the first random number; receiving from the device by the checker a checksum; calculating, by the checker, a reference value based on the first random number and an emulated random access memory of the device, with the aid of the emulated or previously measured hardware function and a predefined cryptographic hash function; checking, by the checker, the checksum based on the reference value; and if the checking is successful, transmitting, by the checker the second random number to the device.
 2. The method as recited in claim 1, wherein, between the transmission of the first random number and the reception of the checksum, the checker measures a measured variable, the measured variable being a time span between the transmission of the first random number and the reception of the checksum, and the checker subjects the measured variable to the check.
 3. The method as recited in claim 1, wherein: the device receives the cryptogram and the first random number from the checker; the device stores the cryptogram in a local random access memory of the device; the device calculates the checksum based on the first random number and the local random access memory, with the aid of the hash function and a native hardware function of the device; the device transmits the checksum to the checker; the device receives the second random number from the checker; the device calculates the key based on the second random number, with the aid of the native hardware function; and the device decrypts the software from the cryptogram using the key.
 4. The method as recited in claim 3, wherein the software includes an executable program, and the device executes the program after the decryption of the software.
 5. The method as recited in claim 3, wherein at least one of: the hardware function is a physically unclonable function of the device; the hardware function is based on a trusted platform module of the device; the hardware function is based on a secret characterizing the device; and the hardware function is based on a SIMPL system of the device.
 6. The method as recited in claim 1, further comprising: padding the software, by the checker, before the encryption in such a way that the cryptogram fills the random access memory of the device.
 7. The method as recited in claim 1, wherein at least one of: i) the checksum and the reference value are message authentication codes based on the hash function, ii) the hash function is a secure hash algorithm, and iii) the check is a cyclic redundancy check.
 8. A non-transitory machine-readable storage medium on which is stored a computer program for transmitting software to a remote device, the computer program, when executed by a processor, causing the processor to perform: generating a first random number and a second random number; calculating a cryptographic key based on the second random number with the aid of an emulated or previously measured hardware function of the device; encrypting the software into a cryptogram using the key; transmitting to the device by the checker the cryptogram; transmitting to the device by the checker the first random number; receiving from the device by the checker a checksum; calculating a reference value based on the first random number and an emulated random access memory of the device, with the aid of the emulated or previously measured hardware function and a predefined cryptographic hash function; checking the checksum based on the reference value; and if the checking is successful, transmitting the second random number to the device.
 9. A device for transmitting software to a remote device, the device designed to: generate a first random number and a second random number; calculate a cryptographic key based on the second random number with the aid of an emulated or previously measured hardware function of the remote device; encrypt the software into a cryptogram using the key; transmit to the remote device the cryptogram; transmitting to the remote device the first random number; receive from the remote device a checksum; calculating a reference value based on the first random number and an emulated random access memory of the remote device, with the aid of the emulated or previously measured hardware function and a predefined cryptographic hash function; check the checksum based on the reference value; and transmit the second random number to the remote device if the checking is successful. 